package com.ch.http.v1.impl;

import com.ch.http.v1.HttpServletImp;
import com.ch.http.v1.HttpServletRequest;
import com.ch.http.v1.HttpServletResponse;
import com.ch.http.v1.ServletException;

import javax.servlet.annotation.WebServlet;
import java.io.IOException;

@WebServlet("/logout.s")
public class LogoutServlet extends HttpServletImp {
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        request.getSession().invalidate();
        response.sendRedirect("/index.html");
    }
}
